package cn.iocoder.yudao.module.handguard.controller.admin.select;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.handguard.controller.admin.publicitytype.vo.PublicitySelectBaseVO;
import cn.iocoder.yudao.module.handguard.service.publicitytype.PublicityTypeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

/**
 * @author: liuweijun
 * @since: 2023/9/26 15:40
 * @description:
 */
@Tag(name = "管理后台 - 公示表选项")
@RestController
@RequestMapping("/hutai/publicity-select")
@Validated
public class SelectController {

    @Resource
    private PublicityTypeService publicityTypeService;

    @GetMapping("/getPublicitySelectListByTypesName")
    @Operation(summary = "获得公示表类目")
    public CommonResult<List<PublicitySelectBaseVO>> getPublicitySelectListByTypesName(String typesName,Long orderId) {
        List<PublicitySelectBaseVO> list = publicityTypeService.getPublicitySelectListByTypesName(typesName,orderId);
        return success(list);
    }

    @GetMapping("/getPublicitySelectListByClassName")
    @Operation(summary = "获得公示表类目值选项")
    public CommonResult<List<PublicitySelectBaseVO>> getPublicitySelectListByClassName(String className,String typesName) {
        List<PublicitySelectBaseVO> list = publicityTypeService.getPublicitySelectListByClassName(className,typesName);
        return success(list);
    }

}
